#ifndef _COMMON_H_
#define _COMMON_H_

#include "cutils.h"

#define DUMP_PKG_DATA(buf, size) { int z = 0; \
	av_log(NULL, AV_LOG_DEBUG, "Dump package data:\n"); \
	for (; z < size;) { \
		av_log(NULL, AV_LOG_DEBUG, \
			"  %02x %02x %02x %02x\n", \
			buf[z + 0], buf[z + 1], buf[z + 2], buf[z + 3]); \
			z += 4; \
	} }

#define dynarray_add(tab, nb_ptr, elem)\
do {\
    __typeof__(tab) _tab = (tab);\
    __typeof__(elem) _elem = (elem);\
    (void)sizeof(**_tab == _elem); /* check that types are compatible */\
    ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
} while(0)

int get_buf(const char *file_name, char **buf);
int get_rtp_index();

#endif

